<?php require('connections/con_gl.php'); ?>

<?php

cekAkses($_SESSION[akses],"PD-5-2");



$colname_edit = "-1";

if (isset($_GET['id'])) {

  $colname_edit = (get_magic_quotes_gpc()) ? $_GET['id'] : addslashes($_GET['id']);

}

mysql_select_db($database_con_gl, $con_gl);

$query_edit = sprintf("SELECT * FROM gl_tipekendaraan WHERE id = %s", $colname_edit);

$edit = mysql_query($query_edit, $con_gl) or die(mysql_error());

$row_edit = mysql_fetch_assoc($edit);

$totalRows_edit = mysql_num_rows($edit);

// --- get barang

mysql_select_db($database_con_gl, $con_gl);

$query_barang = "select a.id, a.barang from gl_barang a, gl_kelompok b where a.kelompok = b.id AND b.jenis='2' order by a.barang";

$barang       = mysql_query($query_barang, $con_gl) or die(mysql_error());

$row_barang   = mysql_fetch_assoc($barang);

$totalRows_barang = mysql_num_rows($barang);

//---

// get master barang

$query_ldata = "select a.id, b.barang, c.area, a.hargasewa, a.supir, a.bbm, a.tol, a.parkir, a.akomod, a.other from gl_jenbar a, gl_barang b, gl_area c where a.jenis='$_GET[id]' AND a.barang = b.id AND a.area= c.id order by b.barang";

$ldata       = mysql_query($query_ldata, $con_gl) or die(mysql_error());

$row_ldata   = mysql_fetch_assoc($ldata);

$total_ldata = mysql_num_rows($ldata);

?>

<link type="text/css" rel="stylesheet" href="css/jquery.wysiwyg.css" />

<script type="text/javascript" src="js/ajax_data.js"></script>

<script type="text/javascript" src="js/jquery.wysiwyg.js"></script>

<script type="text/javascript">

$(document).ready(function() {



	$().ajaxStart(function() {

		$('#loading').show();

		$('#result').hide();

	}).ajaxStop(function() {

		$('#loading').hide();

		$('#result').fadeIn('slow');

	});



	$('#edit').submit(function() {

		$.ajax({

			type: 'POST',

			url: $(this).attr('action'),

			data: $(this).serialize(),

			success: function(data) {

				$('#result').html(data);

			}

		})

		return false;

	});

  $('#result').click(function(){

  $(this).hide();

  });

})

$(function()

  {

	  $('#keterangan').wysiwyg();

  });

</script>

<div id="loading" style="display:none;"><img src="images/loading.gif" alt="loading..." /></div>

<div id="result" style="display:none;"></div>

<h1>Lihat Data Paket Harga Sewa </h1>

<form action="proses/jenisservice.php?act=edit" method="POST" name="edit" id="edit" >

  <table width="100%" border="0" align="center" cellpadding="5" cellspacing="0" class="datatable">
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">Jenis Kendaraan* : </td>
      <td bgcolor="#FFFFFF"><label>
        <?php echo $row_edit['tipekendaraan']; ?>
      </label></td>
    </tr>
	
    <tr valign="top">

      <td width="12%" align="right" bgcolor="#FFFFFF"> Daftar Harga Paket :</td>

      <td width="88%" bgcolor="#FFFFFF"><div id="divMasterBarang"><table width="100%" border="0" cellspacing="0" cellpadding="4" class="datatable">

  <tr>
    <th>Paket Yang tersedia </th>
    <th>Area Ops </th>
    <th width="12%">Harga Sewa</th>
    <th width="10%">Jasa Supir</th>
    <th width="9%">BBM</th>
    <th width="9%">Tol</th>
    <th width="9%">Parkir</th>
    <th width="11%">Akomodasi</th>
    <th width="9%">Other</th>
    </tr>

  <?php if($total_ldata > 0) { do { ?>

  <tr valign="top">

    <td width="18%"><?php echo $row_ldata['barang'];?></a></td>
    <td width="13%"><?php echo $row_ldata['area'];?></td>
    <td align="center"><?php echo number_format($row_ldata['hargasewa'],0,',','.');?></td>
    <td align="center"><?php echo number_format($row_ldata['supir'],0,',','.');?></td>
    <td align="center"><?php echo number_format($row_ldata['bbm'],0,',','.');?></td>
    <td align="center"><?php echo number_format($row_ldata['tol'],0,',','.');?></td>
    <td align="center"><?php echo number_format($row_ldata['parkir'],0,',','.');?></td>
    <td align="center"><?php echo number_format($row_ldata['akomod'],0,',','.');?></td>
    <td align="center"><?php echo number_format($row_ldata['other'],0,',','.');?></td>
    </tr>
  <?php }while($row_ldata = mysql_fetch_assoc($ldata)); } ?>

</table></div></td>
    </tr>


    <tr valign="top">

      <td align="right" bgcolor="#FFFFFF">Keterangan : </td>

      <td bgcolor="#FFFFFF"><label>

      <?php echo $row_edit['keterangan']; ?>

      <input name="id" type="hidden" id="id" value="<?php echo $row_edit['id']; ?>" />

      </label></td>
    </tr>

    

    <tr>

      <td align="left" bgcolor="#FFFFFF"><em>*Harus diisi</em></td>

      <td bgcolor="#FFFFFF">
          <label>
          <input type="button" name="Button" value="Tutup" onclick="javascript:window.close();" />
        </label></td>
    </tr>
  </table>

</form>

